<template>
    <div class="goodsDetail">
        <!-- <h3>商品详情-{{ id }}</h3> -->
        <div class="card" @click="previewImage">
            <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
                <van-swipe-item v-for="(item, index) in thumb" :key="index">
                    <img :src="item.src" />
                </van-swipe-item>
            </van-swipe>
        </div>
        <div class="card">
            <div class="price">
                <span class="sell_price">&yen; {{ goodsInfo.sell_price }}</span>
                <span class="market_price">&yen; {{ goodsInfo.market_price }}</span>
            </div>
            <div class="title van-multi-ellipsis--l2">
                {{ goodsInfo.title }}
            </div>
        </div>
        <div class="card">
            <van-divider content-position="left">介绍</van-divider>
            <div class="content" v-html="goodsInfo.content"></div>
        </div>
        <!-- <van-goods-action>
            <van-goods-action-icon icon="chat-o" text="客服" @click="callPhone" dot />
            <van-goods-action-icon @click="$router.push('/home/shopcar')" icon="cart-o" text="购物车"
                :badge="$store.getters.getCarTotalNumber" />
            <van-goods-action-button type="warning" text="加入购物车" @click="toCar(true)" />
            <van-goods-action-button type="warning" text="立即购买" @click="toBuy(false)" />
        </van-goods-action> -->
        <!-- 商品sku -->
        <van-sku v-model="show" :sku="sku" :goods="goods" :goods-id="goodsInfo.id" :hide-stock="sku.hide_stock"
            :reset-stepper-on-hide="true" :show-add-cart-btn="showAddCartBtn" @add-cart="skuAddCart"
            @buy-clicked="skuBuy">
            <template #sku-messages>
                <div class="card">
                    <van-divider>文字</van-divider>
                    <div>商品货号：{{ goodsInfo.goods_no }}</div>
                    <div>库存：{{ goodsInfo.stock_quantity }}件</div>
                    <div>上架时间：{{ goodsInfo.add_time | dateFormat('YYYY-MM-DD') }}</div>
                </div>
            </template>
        </van-sku>
    </div>
</template>

<script>
    export default {
        data(){
            return {
                id: this.$route.params.id
            }
        }
    }
</script>

<style lang="scss" scoped>

</style>